export const state = () => ({
  counter: 0
})

export const mutations = {
  increment (state) {
    state.counter++
  }
}

export const actions = {
  nuxtServerInit ({ state, commit }, { req }) {
    const keys = Object.keys(req)
    // eslint-disable-next-line
    console.log(state)
    for (const key of keys) {
      if (key.startsWith('_')) {
        continue
      }
      // eslint-disable-next-line
      console.log('===== ' + key + ' =====')
      // eslint-disable-next-line
      // console.log(req[key])
    }
    commit('increment')
  }
}
